<?php
	class baigioithieubs
	{
		// Các trường
		public $MaBaiGioiThieu = 0; // auto_increment
		public $TieuDe = "";
		public $NoiDung = "";
		public $XuatBan = 0;
		
		// Các phương thức
		public function Them()
		{
			$db = new baigioithieudb();
			return $db->Them(	$this->TieuDe,
								$this->NoiDung,
								$this->XuatBan);
		}
		
		public function CapNhatXuatBanBaiGioiThieu()
		{
			$db = new baigioithieudb();
			return $db->CapNhatXuatBanBaiGioiThieu($this->MaBaiGioiThieu, 
									   $this->XuatBan);
		}
		
		public function LayDanhSach()
		{
			$db = new baigioithieudb();
			return $db->LayDanhSach($this->MaBaiGioiThieu, 
									$this->TieuDe, 
									$this->NoiDung,  
									$this->XuatBan);
		}
		
		public function CapNhat()
		{
			$db = new baigioithieudb();
			return $db->CapNhat($this->MaBaiGioiThieu, 
								$this->TieuDe,  
								$this->NoiDung);
		}		
		
		public function XoaTatCa()
		{
			$db = new baigioithieudb();
			return $db->XoaTatCa();
		}
		
		public function Xoa()
		{
			$db = new baigioithieudb();
			return $db->Xoa($this->MaBaiGioiThieu);
		}
	}
?>